<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    Vue生命周期第三个阶段-销毁阶段
    <hr>
    <span id="sp">{{message}}</span>
    <input type="button" @click="changeData()" value="修改数据">
</div>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: "你正在学习Vue生命周期-运行阶段"
        },
        methods: {
            changeData() {
                this.message = "随机数:" + Math.random();
            }
        },
        beforeDestroy(){
            //生命周期中第七个函数，该函数执行时Vue中所有数据(methods,data等)都没有销毁
        },
        destroyed(){
            //生命周期中第八个函数，该函数执行时，Vue实例彻底销毁
        }
    });
</script>
</body>
</html>